package cn.mcartoon.constants;

/**
 * 一些常量
 */
public class Constants {
    /**
     * 否
     */
    public final static Integer MM_NOT = 0;

    /**
     * 是
     */
    public final static Integer MM_YES = 1;

    /**
     * 女
     */
    public final static Integer MM_SEX_WOMEN = 0;

    /**
     * 男
     */
    public final static Integer MM_SEX_MAN = 1;


    /**
     * 访问来源--APP
     */
    public final static Integer SOURCE_TYPE_APP = 0;

    /**
     * 访问来源-PC
     */
    public final static Integer SOURCE_TYPE_PC = 1;

    /**
     * 本项目小数位
     */
    public final static Integer DECIMAL_DIGITS = 2;


    /**
     * 首页相关常量
     */
    public static class Home{

        /**
         * “原创精品”列表数量
         */
        public final static Integer ORIGNAL_SIZE = 24;

        /**
         * “热漫排行”列表数量
         */
        public final static Integer HOTS_SIZE = 5;

        /**
         * “最近更新”查询天数
         */
        public final static Integer ACTIVES_DAYS = 7;

        /**
         * “最近更新”列表数量
         */
        public final static Integer ACTIVES_SIZE = 14;

        /**
         * “完结佳作”列表数量
         */
        public final static Integer FINISH_SIZE = 14;


        /**
         * 题材
         */
        public static Integer THEME = 1;
        /**
         * 进度
         */
        public final static Integer PROGRESS = 2;
        /**
         * 地区
         */
        public final static Integer AREAS = 3;
        /**
         * 受众
         */
        public final static Integer FANS = 4;
        /**
         * 收费
         */
        public final static Integer COST = 5;
        /**
         * 字母
         */
        public final static Integer LETER = 6;
    }


    public static class ImageCode{
        /**
         * 发送状态--发送成功
         */
        public final static Integer STATUS_SEND_SUCCESS = 1;

        /**
         * 发送状态--发送失败
         */
        public final static Integer STATUS_SEND_FAILED = 2;
    }

    /**
     * 短信相关
     */
    public static class Sms{
        /**
         * 发送状态--发送成功
         */
        public final static Integer STATUS_SEND_SUCCESS = 1;

        /**
         * 发送状态--发送失败
         */
        public final static Integer STATUS_SEND_FAILED = 2;


        /**
         * 短信类型--注册或登录验证码
         */
        public final static Integer TYPE_REGIST_OR_LOGIN = 0;
        /**
         * 短信类型--修改密码验证码
         */
        public final static Integer TYPE_UP_PASS = 1;
        /**
         * 短信类型--通知
         */
        public final static Integer TYPE_NOTICE = 2;

        /**
         * 阿里云短信服务返回的Message信息
         */
        public final static String ALI_SMS_RESSULT = "OK";

    }

    /**
     * redis常量
     */
    public static class Redis{
        /**
         * 项目公共 前缀
         */
        public final static String PREFIX = "MM";

        /**
         * 短信相关
         */
        public final static String PREFIX_TOKEN = "token:";

        /**
         * 短信相关
         */
        public final static String PREFIX_SMS = "sms:";

        /**
         * 图片验证码相关
         */
        public final static String PREFIX_IMAGE_CODE = "image_code:";

        /**
         * 首页类型树
         */
        public final static String KEY_HOME_TREE = PREFIX + "_home_classifyTree:";

        /**
         * 首页--完结佳作
         */
        public final static String KEY_HOME_FINISH = PREFIX + "_home_finishs:";

        /**
         * 首页--最近更新
         */
        public final static String KEY_HOME_ACTIVE = PREFIX + "_home_actives:";

        /**
         * 漫画--漫画收藏
         */
        public final static String KEY_CARTOON_COLLECTION = "cartoon_collection:";

    }

    /**
     * 连接符
     */
    public static class Connnector{
        /**
         * 逗号
         */
        public final static String COMMA_ = ",";

        /**
         * 下划线
         */
        public final static String UNDERLINE = "_";

    }

    /**
     * 时长
     */
    public static class Duration{

        /**
         * 一秒
         */
        public final static Integer SECOND = 1;

        /**
         * 一分钟
         */
        public final static Integer MINUTE = SECOND * 60;

        /**
         * 半个小时
         */
        public final static Integer HALF_AN_HOUR = MINUTE * 30;

        /**
         * 一天
         */
        public final static Integer DAY = MINUTE * 60 * 24 ;
    }

    /**
     * 漫画
     */
    public static class Cartoon{
        /**
         * 排序规则
         */
        public static class Sort{
            /**
             * 人气
             */
            public static Integer HOT = 1;
            /**
             * 更新
             */
            public static Integer ACTIVE = 2;
            /**
             * 新品
             */
            public static Integer NEW = 3;
        }

        /**
         * 连载中
         */
        public static Long STATE_SERIAL = 25L;
        /**
         * 完结
         */
        public static Long STATE_FINISH = 26L;

    }

    /**
     * 章节
     */
    public static class Chapter{

        /**
         * 需要付费
         */
        public static Integer IS_PAY = 1;
        /**
         * 不需要付费
         */
        public static Integer NO_PAY = 2;

    }

    /**
     * 漫画评论
     */
    public static class Comment{

        /**
         * 评论漫画
         */
        public static Integer TYPE_CARTOON = 1;
        /**
         * 回复评论
         */
        public static Integer TYPE_REPLY = 2;

    }

    public static class Collection{

        /**
         * 已收藏
         */
        public static Integer STATE_COLLECTION = 1;
        /**
         * 取消收藏
         */
        public static Integer STATE_NO_COLLECTION = 2;

    }


    /**
     * 订单
     */
    public static class Order{

        /**
         * 支付状态
         */
        public static class payStatus{
            /**
             * 待支付
             */
            public static Integer WAIT = 1;
            /**
             * 支付成功
             */
            public static Integer SUCCESS = 2;
            /**
             * 支付失败
             */
            public static Integer FAIL = 3;
        }

        /**
         * 支付状态
         */
        public static class WechatTradeResult{
            /**
             * 支付成功
             */
            public static String SUCCESS = "Y";
            /**
             * 支付失败
             */
            public static String FAIL = "N";
        }

    }



    /**
     * 手机号简单正则
     */
    public static String PHONE_REGSTR = "^[1][0-9]{10}$";
    /**
     * 密码正则
     */
    public static String PASSWORD_REGSTR = "^([A-Z]|[a-z]|[0-9]|[_]){6,10}$";

}
